
//频道
angular.module('mamApp').factory('TagsManager', ['$http','api','paramsManager', function ($http,api,paramsManager) {
    var TagsManager = {

        /**
         * 所有通用标签纬度
         * @param params
         * @returns
         */

        commonDimensions: function (params) {
            return $http.get(api+'/admin/cdimensions/'+paramsManager.params(params)).then(function (result) {
                return result;
            });
        },
        /**
         * 所有通用标签纬度
         * @param params
         * @returns
         */

        anchorDimensions: function (params) {
            return $http.get(api+'/admin/adimension/'+paramsManager.params(params)).then(function (result) {
                return result;
            });
        },
        /**
         * 添加通用标签纬度
         * @param params
         * @returns
         */

        commonDimensionsAdd: function (params) {
            return $http.post(api+'/admin/cdimension',params).then(function (result) {
                return result;
            });
        },
        /**
         * 添加通用标签纬度
         * @param params
         * @returns
         */

        anchorDimensionsAdd: function (params) {
            return $http.post(api+'/admin/adimension',params).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签纬度详情
         * @param params
         * @returns
         */

        commonDimensionsDetail: function (dimensionId) {
            return $http.get(api+'/admin/cdimension/'+dimensionId).then(function (result) {
                return result;
            });
        },
        /**
         * 主播标签纬度详情
         * @param params
         * @returns
         */

        anchorDimensionsDetail: function (dimensionId) {
            return $http.get(api+'/admin/adimension/'+dimensionId).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签纬度修改
         * @param params
         * @returns
         */

        commonDimensionsEdit: function (dimensionId,params) {
            return $http.put(api+'/admin/cdimension/'+dimensionId,params).then(function (result) {
                return result;
            });
        },  /**
         * 主播标签纬度修改
         * @param params
         * @returns
         */

        anchorDimensionsEdit: function (dimensionId,params) {
            return $http.put(api+'/admin/adimension/'+dimensionId,params).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签纬度删除
         * @param params
         * @returns
         */

        commonDimensionsDelete: function (ids) {
            return $http.delete(api+'/admin/cdimension/'+ids.join(",")).then(function (result) {
                return result;
            });
        },
        /**
         * 主播标签纬度删除
         * @param params
         * @returns
         */

        anchorDimensionsDelete: function (ids) {
            return $http.delete(api+'/admin/adimension/'+ids.join(",")).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签纬度是否存在
         * @param params
         * @returns
         */

        commonDimensionsCheck: function (params) {
            return $http.post(api+'/admin/cdimension/checkCdimension',params).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签纬度状态修改
         * @param params
         * @returns
         */

        commonDimensionsChangeStatus: function (ids,params) {
            return $http.put(api+'/admin/cdimension/status/'+ids.join(","),params).then(function (result) {
                return result;
            });
        },
        /**
         * 主播标签纬度状态修改
         * @param params
         * @returns
         */

        anchorDimensionsChangeStatus: function (ids,params) {
            return $http.put(api+'/admin/adimension/status/'+ids.join(","),params).then(function (result) {
                return result;
            });
        },
        /**
         * 某个纬度下面的通用标签列表
         * @param params
         * @returns
         */

        cdimensionTags: function (dimensionId,params,query) {
            return $http.get(api+'/admin/cdimension/'+dimensionId+'/commtags/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 某个纬度下面的主播标签列表
         * @param params
         * @returns
         */

        cdanchorTags: function (dimensionId,params,query) {
            return $http.get(api+'/admin/adimension/'+dimensionId+'/anchortag/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签修改状态
         * @param params
         * @returns
         */

        commonTagStatusChange: function (ids,status) {
            return $http.put(api+'/admin/commtag/status/'+ids.join(","),status).then(function (result) {
                return result;
            });
        }, /**
         * 主播标签修改状态
         * @param params
         * @returns
         */

        anchorTagStatusChange: function (ids,status) {
            return $http.put(api+'/admin/anchortag/status/'+ids.join(","),status).then(function (result) {
                return result;
            });
        },
        /**
         * 删除通用标签
         * @param params
         * @returns
         */

        commonTagsDelete: function (ids) {
            return $http.delete(api+'/admin/commtag/'+ids.join(",")).then(function (result) {
                return result;
            });
        },
        /**
         * 删除主播标签
         * @param params
         * @returns
         */

        anchorTagsDelete: function (ids) {
            return $http.delete(api+'/admin/anchortag/'+ids.join(",")).then(function (result) {
                return result;
            });
        },

        /**
         * 添加通用标签
         * @param params
         * @returns
         */

        commonTagsAdd: function (params) {
            return $http.post(api+'/admin/commtag',params).then(function (result) {
                return result;
            });
        },
        /**
         * 添加主播标签
         * @param params
         * @returns
         */

        anchorTagsAdd: function (params) {
            return $http.post(api+'/admin/anchortag',params).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签修改
         * @param params
         * @returns
         */

        commonTagsEdit: function (tagId,params) {
            return $http.put(api+'/admin/commtag/'+tagId,params).then(function (result) {
                return result;
            });
        },
        /**
         * 主播标签修改
         * @param params
         * @returns
         */

        anchorTagsEdit: function (tagId,params) {
            return $http.put(api+'/admin/anchortag/'+tagId,params).then(function (result) {
                return result;
            });
        },
        /**
         * 所有通用标签列表
         * @param params
         * @returns
         */

        commonTags: function () {
            return $http.get(api+'/admin/tags/commtags').then(function (result) {
                return result;
            });
        },
        /**
         * 二级频道
         * @param params
         * @returns
         */

        specialTags: function (channelId) {
            return $http.get(api+'/admin/tags/'+channelId+'/specialtags').then(function (result) {
                return result;
            });
        },
        /**
         * 关键词标签列表
         * @param params
         * @returns result
         */
        keywordTagsList: function (params,query) {
            return $http.get(api+'/admin/keywordtags/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签列表--频道
         * @param params
         * @returns
         */

        specialTagsChannelList: function (params) {
            return $http.get(api+'/admin/specialtag/channel/'+paramsManager.params(params)).then(function (result) {
                return result;
            });
        },
        /**
         * 所有专用标签纬度
         * @param params
         * @returns
         */

        specialDimensions: function (params) {
            return $http.get(api+'/admin/sdimensions/'+paramsManager.params(params)).then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签纬度状态修改
         * @param params
         * @returns
         */

        specialDimensionsChangeStatus: function (dimensionId,params) {
            return $http.put(api+'/admin/sdimension/status/'+dimensionId,params).then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签纬度删除
         * @param params
         * @returns
         */

        specialDimensionsDelete: function (dimensionId) {
            return $http.delete(api+'/admin/sdimension/'+dimensionId).then(function (result) {
                return result;
            });
        }, 
        /**
         * 专用标签纬度详情
         * @param params
         * @returns
         */

        specialDimensionsDetail: function (dimensionId) {
            return $http.get(api+'/admin/sdimension/'+dimensionId).then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签纬度是否存在
         * @param params
         * @returns
         */

        specialDimensionsCheck: function (params) {
            return $http.post(api+'/admin/sdimension/checkSdimension',params).then(function (result) {
                return result;
            });
        },
        /**
         * 添加专用标签纬度
         * @param params
         * @returns
         */

        specialDimensionsAdd: function (params) {
            return $http.post(api+'/admin/sdimension',params).then(function (result) {
                return result;
            });
        },
        /**
         * 添加专用标签纬度-->上级频道列表（启用状态的频道）
         * @param params
         * @returns
         */

        specialCreateChannelList: function () {
            return $http.get(api+'/admin/channel/categorys').then(function (result) {
                return result;
            });
        },
        /**
         * 修改专用标签纬度-->上级频道列表（被选中的值）
         * @param params
         * @returns
         */

        specialEditChannelList: function (dimensionId) {
            return $http.get(api+'/admin/sdimension/'+dimensionId).then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签纬度修改
         * @param params
         * @returns
         */

        specialDimensionsEdit: function (dimensionId,params) {
            return $http.put(api+'/admin/sdimension/'+dimensionId,params).then(function (result) {
                return result;
            });
        },
        /**
         * 某个纬度下面的专用标签列表
         * @param params
         * @returns
         */

        sdimensionTags: function (dimensionId,params,query) {
            return $http.get(api+'/admin/sdimensions/'+dimensionId+'/specialtags/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签修改状态
         * @param params
         * @returns
         */

        specialTagStatusChange: function (specialId,params) {
            return $http.put(api+'/admin/specialtag/status/'+specialId,params).then(function (result) {
                return result;
            });
        },
        /**
         * 删除专用标签
         * @param params
         * @returns
         */

        specialTagDelete: function (specialId) {
            return $http.delete(api+'/admin/specialtag/'+specialId).then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签是否存在
         * @param params
         * @returns
         */

        specialTagCheck: function (params) {
            return $http.post(api+'/admin/specialtag/checkSpecialtag',params).then(function (result) {
                return result;
            });
        },
        /**
         * 添加专用标签
         * @param params
         * @returns
         */

        specialTagAdd: function (params) {
            return $http.post(api+'/admin/specialtag',params).then(function (result) {
                return result;
            });
        },
        /**
         * 专用标签修改
         * @param params
         * @returns
         */

        specialTagEdit: function (specialId,params) {
            return $http.put(api+'/admin/specialtag/'+specialId,params).then(function (result) {
                return result;
            });
        },



    };

    return TagsManager;
}]);
